package com.ruoyi.wlxz.controller;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.wlxz.service.StopWordsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 停止词管理
 */
@RestController
@RequestMapping("/wlxz/stopWords")
public class StopWordsController {
    @Autowired
    private StopWordsService stopWordsService;

    /**
     * 添加停用词
     *
     * @param words
     * @return
     */
    @PostMapping("/words")
    public AjaxResult addStopWords(@RequestParam String[] words) {
        stopWordsService.addStopWords(words);
        return AjaxResult.success();
    }

    /**
     * 查询停止词
     */
    @GetMapping("/list")
    public AjaxResult getStopWords() {
        return AjaxResult.success(stopWordsService.getStopWords());
    }
}
